-- CALC_SINGLE_PET_ABILITY
-- 计算一个宠物的战力

return function(pet)
    -- 暂时随便写的，需要和服务器一致
    local ret = 0;
    local k = 1;      -- 成长系数
    local rank = pet:getRank();
    local feedTimes = #pet.feedRecord;
    local grow_co = { 300, 750, 1500, 6000, 9600, };
    local feed_co = { 20, 50, 180,  400,  1200, };
    local medal_co = { 200, 400, 1600, 2400, 3200, };
    local weapon_co = { 250, 500, 2000, 3000, 4000,};
    local abilityInfo = { ["rank"] = 0, ["equip"] = 0, ["feed"] = 0, };

    -- 冈布奥阶位加成
    for i = 1, rank do
        ret = ret + grow_co[i] * k;

        abilityInfo["rank"] = abilityInfo["rank"] + grow_co[i] * k;
    end

    -- 喂食加成
    ret = ret + feed_co[rank] * k * feedTimes;

    abilityInfo["feed"] = abilityInfo["feed"] + feed_co[rank] * k * feedTimes;

    -- 武器、徽章
    local equipments = pet.equipments;
    for _, arr in pairs(equipments) do
        for _, classId in pairs(arr) do
            rank = EquipM.query(classId, "rank");

            if EquipM.query(classId, "type") == EQUIP_TYPE_MEDAL then
                -- 徽章
                ret = ret + medal_co[rank] * k;

                abilityInfo["equip"] = abilityInfo["equip"] + medal_co[rank] * k;
            else
                -- 武器
                ret = ret + weapon_co[rank] * k;

                abilityInfo["equip"] = abilityInfo["equip"] + weapon_co[rank] * k;
            end
        end
    end

    -- 觉醒冈布奥的加成
    if AwakeM.isCarved(pet.classId) then
        ret = ret + 10000;
        abilityInfo["equip"] = abilityInfo["equip"] + 10000;
    end

    return ret, abilityInfo;
end
